/**
 *paihangbang
 */

module components {
    export class PHB_jilvPanel extends eui.Component {
        public icon: eui.Image;
        public phb_bg: eui.Image;
        public icon_right: eui.Image;
        public icon_txk: eui.Image;
        public icon_tx: eui.Image;
        public phbname: eui.Label;
        public phbscore: eui.Label;
        public rankIdNum: eui.BitmapLabel;
        private object: any;
        private showright: boolean;
        public constructor(object, showright) {
            super();
            object ? this.object = object : ""
            showright ? this.showright = showright : ""
            this.addEventListener(egret.Event.COMPLETE, this.init, this)
            this.skinName = "resource/ui/components/PHB_jilvSkin.exml";
        }
        private init() {

            //初始化数据
            if (this.object) {
                var FaceId//头像
                var RankType//今天 上周 本周
                var RankId//排名
                var SumScore//积分
                var UserID//
                var UserName//
                FaceId = this.object["FaceId"]
                RankType = this.object["RankType"]
                RankId = Number(this.object["RankId"])
                SumScore = Number(this.object["SumScore"])
                UserID = this.object["UserID"];
                UserName = this.object["UserName"]
                this.phbname.text = Global.cutString(UserName)
                this.phbscore.text = Global.returnFloat(SumScore / 100) + "";
                this.rankIdNum.text = Global.getmeishufen(RankId, true)
                RankId <= 3 ? (this.phb_bg.source = "phb_tiao_" + RankId, this.icon.source = "phb_nob" + RankId, this.icon_right.source = "phb_jj" + RankId) : (this.phb_bg.source = "phb_tiao_4", this.icon.source = "", this.icon_right.source = "")
                this.showright ? this.icon_right.visible = true : this.icon_right.visible = false
                this.icon_txk.source = "phb_txk";
                this.icon_tx.source = "special_" + FaceId;
            }


        }
    }

}